//引入experss模块
const express = require('express');
//引入连接池
const pool = require('../pool');
//创建头条路由器
const details = express.Router();
//创建头条详情的接口
details.get('/details',(req,res)=>{
  let did=req.query.did;
  let sql ='select did,devent,dtitle,dtime,dphoto,dthing,dtou,details from tykyo_detail where did=?';
  //执行SQL语句
  pool.query(sql,[did],(error,results)=>{
    if(error) throw error;
    res.send({message:'ok',code:200,results:results});
  });
});
module.exports=details;